﻿namespace KuiHuaBaoDian.Services.Lockstep {

    /// <summary>
    /// 帧同步实体
    /// </summary>
    public interface ILockstepEntity {

        /// <summary>
        /// 执行逻辑帧
        /// </summary>
        void DoLogicFrame(int frameIndex);

        /// <summary>
        /// 加入帧同步服务时响应
        /// </summary>
        void OnAttached(int frameIndex);

        /// <summary>
        /// 移出帧同步服务时响应
        /// </summary>
        void OnDetached();

        /// <summary>
        /// 执行更新显示对象
        /// </summary>
        /// <param name="frameIndex">当前帧</param>
        /// <param name="syncedFrameCount">上一次同步的逻辑帧数量</param>
        /// <param name="deltaTime">经过的时长(已缩放)</param>
        /// <param name="timeScale">当前时间的缩放量</param>
        void DoUpdate(int frameIndex, int syncedFrameCount, float deltaTime, float timeScale);
    }
}
